<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/commonHead :: commonHead('登录记录')"></head>
<body>
<div th:replace="/common/titleNav :: titleNavDiv"></div>
<div class="content" th:with="oneMenu='2',twoMenu='7'">
    <div th:replace="/common/sidebarNav :: sidebarDiv"></div>
    <div class="main">
        <div class="right">
            <div class="title">
                <a class="btn btn-primary" href="javascript:void(0);" id="btnExport">导出</a>
            </div>
            <form th:action="@{/loginHistory/list}" method="post" id="queryForm">
                <input type="hidden" name="id" value=""/>
                <input type="hidden" name="userIdName"/>
                <input type="hidden" name="page" th:value="${entity.page}"/>
                <input type="hidden" name="rows" th:value="${entity.rows}"/>
                <table class="table table-form">
                    <thead>
                    <tr>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td align="right"><span class="form-label">用户:</span></td>
                        <td>
                            <select class="default-basic-single" style="width:100%;" name="userId">
                                <option th:if="${entity?.userId != null}" th:value="${entity.userId}" selected="selected" th:text="${entity.userIdName}"></option>
                            </select>
                        </td>
                        <td align="right"><span class="form-label">IP地址:</span></td>
                        <td><input class="form-control" type="text" name="address" th:value="${entity.address}"
                                   placeholder="请输入"/></td>
                        <td align="right"><span class="form-label">时间:</span></td>
                        <td>
                            <input style="width: 45%; display: inline;" class="form-control" type="text" name="createTimeBegin" readonly th:value="${entity.createTimeBegin}" placeholder="请选择"/>
                            <span style="width: 10%; display: inline;" class="form-label">至</span>
                            <input style="width: 45%; display: inline;" class="form-control" type="text" name="createTimeEnd" readonly th:value="${entity.createTimeEnd}" placeholder="请选择"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right"><span class="form-label">部门名称:</span></td>
                        <td colspan="3">
                            <input class="form-control" type="text" name="deptName" th:value="${entity.deptName}"
                                   placeholder="请输入"/>
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="5">
                            <a href="javascript:void(0);" class="btn btn-primary" id="btnQuery">查询</a>
                            <a href="javascript:void(0);" class="btn btn-default border-blue" style="margin-left:15px;"
                               id="btnReset">清空</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
            <div style="overflow-x:auto; padding: 0 5px;">
                <table class="table table-bordered table-striped table-condensed table-hover"
                       style="table-layout: fixed;" name="resizableTable">
                    <thead>
                    <tr>
                        <th width="10%">用户</th>
                        <th width="20%">邮箱</th>
                        <th width="30%">部门名称</th>
                        <th width="10%">类型</th>
                        <th width="15%">IP地址</th>
                        <th width="15%">时间</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr th:each="entity : ${rows}">
                            <td th:title="${entity.userIdName}" th:text="${entity.userIdName}"></td>
                            <td th:title="${entity.email}" th:text="${entity.email}"></td>
                            <td th:title="${entity.deptName}" th:text="${entity.deptName}"></td>
                            <td th:title="${entity.type == 1 ?'登录':'登出'}" th:text="${entity.type == 1 ?'登录':'登出'}"></td>
                            <td th:title="${entity.address}" th:text="${entity.address}"></td>
                            <td th:title="${entity.createTime}" th:text="${entity.createTime}"></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <ul class="pagination" id="pagination"></ul>
            <div class="page-msg">共<span th:text="${total}"></span>记录</div>
        </div>
    </div>
</div>
<!---导出-->
<form th:action="@{/loginHistory/export}" method="post" id="exportForm">
    <input type="hidden" name="userId">
    <input type="hidden" name="address">
    <input type="hidden" name="createTimeBeginStr">
    <input type="hidden" name="createTimeEndStr">
</form>
<input type="hidden" th:value="${total}" id="totalValue">
<script type="text/javascript" th:src="@{/static/javascript/admin/loginHistory/list.js}"></script>
</body>
</html>